package com.bosssoft.hr.train.j2se.exception;

/**
 * ExceptionDemo
 * 异常类作业完成method1和method2
 */
public class ExceptionDemo {
    /**
     *  method1
     *  内部模拟try catch系统异常然后 转化抛出 BusinessException
     */
    public  void method1(){
        throw new BusinessException(ResponseEnum.ERROR);
    }
    /**
     *  method2
     *  内部抛出 throw new Exception()
     */
    public void method2() throws Exception {
        try{

        }catch (Exception e){
            throw new Exception(e);
        }
    }
    /**
     * 按作业要求测试异常
     */
    public static void main(){
        ExceptionDemo exceptionDemo = new ExceptionDemo();
        exceptionDemo.method1();
        try{
            exceptionDemo.method2();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
